<admintpl file="header" />
</head>
<body>
	<div class="wrap">
		<ul class="nav nav-tabs">
			<li class="active"><a >消费记录</a></li>
		</ul>
		<php>
			$type=array("income"=>"收入","expend"=>"支出");
			$action=array("sendgift"=>"赠送礼物","sendbarrage"=>"弹幕","loginbonus"=>"登录奖励","buyvip"=>"购买VIP","buycar"=>"购买坐骑","buyliang"=>"购买靓号",'game_bet'=>'游戏下注','game_return'=>'游戏退还','game_win'=>'游戏获胜','game_banker'=>'庄家收益','set_deposit'=>'上庄扣除','deposit_return'=>'下庄退还','roomcharge'=>'房间扣费','timecharge'=>'计时扣费','sendred'=>'发送红包','robred'=>'抢红包','buyguard'=>'开通守护','reg_reward'=>'注册奖励');
		</php>
		<form class="well form-search" method="post" action="{:U('Coinrecord/index')}">
            <if condition="$showlevel eq 0">
            代理商：
			<select class="select_2" name="proxyid" id="proxyid">
				<option value="">全部</option>
			</select>
            </if>
            <if condition="$showlevel lt 2">
            业务员：
			<select class="select_2" name="promoterid" id="promoterid">
				<option value="">全部</option>
                <volist name="promoterlist" id="v">
				<option value="{$v['id']}" <if condition="$formget.promoterid eq $v['id']">selected</if> >{$v['user_nicename']}</option>
                </volist>	
			</select>
            </if>
			收支类型： 
			<select class="select_2" name="type">
				<option value="">全部</option>
				<volist name="type" id="v">
					<option value="{$key}" <if condition="$formget.type eq $key">selected</if> >{$v}</option>
				</volist>

			</select> &nbsp;&nbsp;
			收支行为： 
			<select class="select_2" name="action">
				<option value="">全部</option>
				<volist name="action" id="v">
					<option value="{$key}" <if condition="$formget.action eq $key">selected</if> >{$v}</option>
				</volist>
			</select> &nbsp;&nbsp;
			赠送时间：
			<input type="text" name="start_time" class="js-date date" value="{$formget.start_time}" style="width: 80px;" autocomplete="off">-
			<input type="text" class="js-date date" name="end_time" value="{$formget.end_time}" style="width: 80px;" autocomplete="off"> &nbsp; &nbsp;
			会员： 
			<input type="text" name="uid" style="width: 200px;" value="{$formget.uid}" placeholder="请输入会员ID值...">
			主播： 
			<input type="text" name="touid" style="width: 200px;" value="{$formget.touid}" placeholder="请输入主播ID值...">
			<input type="submit" class="btn btn-primary" value="搜索">
		</form>		
		
		<form method="post" class="js-ajax-form">
	
			<table class="table table-hover table-bordered">
				<thead>
					<tr>
						<th align="center">ID</th>
						<th>收支类型</th>
						<th>收支行为</th>
						<th>会员 (ID)</th>
						<th>主播 (ID)</th>
						<th>行为说明 (ID)</th>
						<th>数量</th>
						<th>总价</th>
						<th>直播id</th>
						<th>时间</th>

						<!-- <th align="center">{:L('ACTIONS')}</th> -->
					</tr>
				</thead>
				<tbody>
					
					<foreach name="lists" item="vo">
					<tr>
						<td align="center">{$vo.id}</td>
						<td>{$type[$vo['type']]}</td>
						<td>{$action[$vo['action']]}</td>
						<td>{$vo['userinfo']['user_nicename']} ( {$vo['uid']} )</td>
						<td>{$vo['touserinfo']['user_nicename']} ( {$vo['touid']} )</td>
						<td>{$vo['giftinfo']['giftname']} ( {$vo['giftid']} )</td>
						<td>{$vo['giftcount']}</td>
						<td>{$vo['totalcoin']}</td>
						<td>{$vo['showid']}</td>
	
						<td>{$vo.addtime|date="Y-m-d H:i:s",###}</td>

						<!-- <td align="center">	 -->
							<!-- <a href="{:U('Coinrecord/edit',array('id'=>$vo['id']))}" >编辑</a> |
							<a href="{:U('Coinrecord/del',array('id'=>$vo['id']))}" class="js-ajax-dialog-btn" data-msg="您确定要删除吗？">删除</a> -->
						<!-- </td> -->
					</tr>
					</foreach>
				</tbody>
			</table>
			<div class="pagination">{$page}</div>

		</form>
	</div>
	<script src="__PUBLIC__/js/common.js"></script>
    <script>
        var list='{$proxylistj}';
        var proxyid='{$formget['proxyid']}';
        var promoterid='{$formget['promoterid']}';
        var lists='';
        if(list){
            lists=typeof(list)=='object'?list:JSON.parse(list);
        }
        
        
        function cteateProxyid(){
            if(!lists){
                return !1;
            }
            var proxy_html='<option value="">全部</option>';
            for(var k in lists){
                var v=lists[k];
                if(k==proxyid){
                    proxy_html+='<option value="'+v.id+'" selected>'+v.user_nicename+'</option>';
                }else{
                    proxy_html+='<option value="'+v.id+'">'+v.user_nicename+'</option>';
                }
            }
            
            $("#proxyid").html(proxy_html);
            if(proxyid){
                cteatePromoterid();
            }
        }
        
        function cteatePromoterid(){
            if(!lists){
                return !1;
            }
            var promoter_html='<option value="">全部</option>';
            
            if(proxyid){
            var list2=lists[proxyid]['list'];

                for(var k in list2){
                    var v=list2[k];
                    if(k==promoterid){
                        promoter_html+='<option value="'+v.id+'" selected>'+v.user_nicename+'</option>';
                    }else{
                        promoter_html+='<option value="'+v.id+'">'+v.user_nicename+'</option>';
                    }
                    
                }
            }
            $("#promoterid").html(promoter_html);
        }

        cteateProxyid();

        $("#proxyid").change(function(){
            proxyid=$(this).val();
            cteatePromoterid();
        })
        
    </script>
</body>
</html>